package com.smart.manager.member.entities.bodys;

import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.member.entities.enums.PropsKind;
import com.smart.manager.member.entities.views.MemberView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * @author leo
 * @date 2023/10/04
 */
public class RMemberMaterialProps {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RMemberMaterialProps1")
    public static class SearchBody extends BaseSearch {

        @ApiModelProperty("会员名称")
        private String member;

        @ApiModelProperty("物品类型")
        private PropsKind kind;
    }

    @Data
    @ApiModel("RMemberProfileMain2")
    @Accessors(chain = true)
    public static class EditBody implements Serializable {

        @ApiModelProperty("会员编号")
        @Valid
        @NotNull(message = "会员编号 不能为空")
        private MemberView member;

        @ApiModelProperty("物品数量")
        @NotBlank(message = "物品数量 不能为空")
        @Min(value = 1,message = "物品数量 必须大于等于 1")
        private Integer number;

        @ApiModelProperty("物品类型")
        @NotNull(message = "物品类型 不能为空")
        private PropsKind kind;

        @ApiModelProperty("物品名称")
        @NotBlank(message = "物品类型 不能为空")
        private String name;

        @ApiModelProperty("物品图标")
        @NotBlank(message = "物品类型 不能为空")
        private String icon;

        @ApiModelProperty("物品档案代码")
        @NotBlank(message = "物品档案代码 不能为空")
        private String code;

        @ApiModelProperty("物品详情")
        private transient Object detail;

        @ApiModelProperty("物品耐久度")
        private Integer durable;


    }

}
